[Unit]
Description=A lightweight connection pooler for PostgreSQL
Documentation=https://www.pgbouncer.org/
After=syslog.target
After=network.target
After=postgres.service
Wants=postgres.service

[Service]
Type=simple
User={{ pg_dbsu }}
Group=postgres
Environment=BOUNCERCONF=/etc/pgbouncer/pgbouncer.ini
PIDFile=/var/run/postgres/pgbouncer.pid
ExecStart=/usr/bin/pgbouncer ${BOUNCERCONF}
ExecReload=/usr/bin/kill -HUP $MAINPID
KillSignal=SIGINT
TimeoutSec=300

Restart=on-failure
RestartSec=10s

[Install]
WantedBy=multi-user.target